package com.yc.http.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class createproxy implements InvocationHandler{

	
	private Object target;

	
	public void setTarget(Object target) {
		this.target = target;
	}
	

	public Object getNewProxyInstance() {
		return Proxy.newProxyInstance(this.getClass().getClassLoader(), target.getClass().getInterfaces(), this);
	}
	


	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		
		Object invoke=method.invoke(target, args);
		
		return invoke;
	}
	

	
	
	
	
	
	
}
